Classes
Position​
- C++
- Python
- Java
int get_x()int get_y()double distance_to(Position)
x: inty : intdistance_to(Position): float
int getX()int getY()double distanceTo(Position other)
Attacker​
- C++
- Python
- Java
size_t get_hp()size_t get_id()size_t get_type()Position get_position()size_t is_ability_active
hp: intid: inttype: AttackerTypeposition: Positionis_ability_active: int
int getId()int getHp()int getType()Position getPosition()int is_ability_active
PvPState​
- C++
- Python
- Java
const std::vector<Attacker>& get_attackers()const std::vector<Attacker>& get_opponent_attackers()size_t get_turn_no()size_t get_coins_left()
attackers: List[Attacker]opponent_attackers: List[Attacker]turn_no: intno_of_coins_left: int
List<Attacker> getAttackers()List<Attacker> getOpponentAttackers()int getTurnNo()int getCoinsLeft()Game​
- C++
- Python
- Java
void spawn_attacker(size_t type_id, Position pos): Spawns Attacker of type type_id at Position posbool already_spawned_at_position(Position pos): Given a Position pos, it will return whether some attacker was already spawned in that position in the current turnstd::set<size_t> already_activated_attacker_ids: Returns a set of attacker ids which had been activated till now. Its a static variable. Shouldnt be modified by the player , ideally a read only attributevoid set_target(size_t attacker_id, size_t opponent_attacker_id): Sets the target for Attacker with id=attacker_id as Attacker with id=opponent_attacker_id. If the opponent_attacker_id is invalid, the simulator will handle that automatically and try to set the target which is at the nearest position to your Attackervoid activate_ability(size_t attacker_id): Activates the ability for the given attacker with id=attacker_id. If the attacker_id is invalid it does nothing.void set_target(const Attacker &attacker, const Attacker &opponent_atttacker): Sets the target for Attacker(attacker) as Atttacker(opponent_attacker). If the opponent_attacker is invalid somehow, the simulator will handle that automatically and try to set the target which is at the nearest position to your Attackerstd::ostringstream &logr(): Given a Game object(called game), you can dogame.logr()<<"Log This\n";and it will be shown in the renderer logs when the game is being renderedconst std::unordered_map<size_t, size_t> &get_player_set_targets()const std::vector<std::pair<size_t, Position>> &get_spawn_positions()const std::set<Position> &get_already_spawned_positions() const
spawn_attacker(type_id: int, position: Position): Spawns Attacker of type type_id at Position posis_already_spawned_at_position(position: Position): bool: Given a Position pos, it will return whether some attacker was already spawned in that position in the current turnset_target(attacker_id: int, opponent_attacker_id: int): Sets the target for Attacker with id=attacker_id as Attacker with id=opponent_attacker_id. If the opponent_attacker_id is invalid, the simulator will handle that automatically and try to set the target which is at the nearest position to your Attackeralready_activated_attacker_ids : set[int]: Returns a set of attacker ids which had been activated till now. Its a static variable. Shouldnt be modified by the player , ideally a read only attributeactivate_ability(attacker_id:int): Activates the ability for Attacker with id=attacker_id. If the attacker_id is invalid it does nothing. throws an error if the id is not an int.log(line: str):Given a Game object(called game), you can dogame.log("Log This\n")and it will be shown in the renderer logs when the game is being renderedclear_log()player_set_targets: Dict[int, int]spawn_positions: List[Tuple[int, Position]]already_spawned_positions: Set[Position]
void spawnAttacker(int type_id, Position pos): Spawns Attacker of type type_id at Position posboolean alreadySpawnedAtPosition(Position pos): Given a Position pos, it will return whether some attacker was already spawned in that position in the current turnSet<Integer> already_activated_attacker_ids: Returns a set of attacker ids which had been activated till now. Its a static variable. Shouldnt be modified by the player , ideally a read only attributevoid setTarget(int attacker_id, int opponent_attacker_id): Sets the target for Attacker with id=attacker_id as Attacker with id=opponent_attacker_id. If the opponent_attacker_id is invalid, the simulator will handle that automatically and try to set the target which is at the nearest position to your Attackeractivate_ability(attacker_id:int): Activates the ability for Attacker with id=attacker_id. If the attacker_id is invalid it does nothing. throws an error if the id is not an int.void setTarget(Attacker attacker, Attacker opponent_attacker): Sets the target for Attacker(attacker) as Attacker(opponent_attacker). If the opponent_attacker is invalid somehow, the simulator will handle that automatically and try to set the target which is at the nearest position to your Attackervoid log(String s)Given a Game object(called game), you can dogame.log("Log This\n")and it will be shown in the renderer logs when the game is being renderedvoid clearLog()List<SpawnDetail> getSpawnPositions()Map<Integer, Integer> getPlayerSetTargets()
AttackerType (Python Specific)​
hp: intrange: intattack_power: intprice: intspeed: intis_aerial: int
Attributes (C++ and Java Specific)​
This class stores the attributes for Attacker. This will be used as the value type in Constants for storing attributes of Attacker type.
- C++
- Java
unsigned hpunsigned rangeunsigned attackPowerunsigned speedunsigned priceunsigned is_aerialunsigned weightunsigned ability_activation_cost
int hpint rangeint attack_powerint speedint priceint is_aerialunsigned weightunsigned ability_activation_cost
SpawnDetail (Java Specific)​
int getTypeId(): Returns the typeId of the spawnPosition getPos(): Returns the position of the spawn